package com.jacky.javase;

public class Demo01 extends Thread{
    public static void main(String[] args) {
//        new Demo01().show();

//        String a = "hi";
//        String b = new String("hi");
//        System.out.println(a+"   "+ a.hashCode());
//        System.out.println(b+"   "+ b.hashCode());
//        System.out.println(System.identityHashCode(a));
//        System.out.println(System.identityHashCode(b));
//        System.out.println("a==b = "+(a==b));
//        System.out.println("a.equals(b) = "+a.equals(b));


        for (int i = 0; i < 5; i++) {
            new Demo01().start();
//            new Demo01().run();
        }
    }

    @Override
    public void run() {
        SingletonL l = SingletonL.getInstance();
        System.out.println(l);
    }

    public void show(){
        System.out.println("java show");
    }

    public void add(){
        String str = "这是add方法里的字符串";
        new Demo01();
    }
}
